#ifndef BMPWRITER_H
#define BMPWRITER_H

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef long BOOL;

typedef long LONG;

typedef unsigned char BYTE;

typedef unsigned long DWORD;

typedef unsigned short WORD;

#include <pshpack2.h>

typedef struct {

	WORD    bfType;

	DWORD   bfSize;

	WORD    bfReserved1;

	WORD    bfReserved2;

	DWORD   bfOffBits;

} BMPFILEHEADER_T;

struct BMPFILEHEADER_S{

	WORD    bfType;

	DWORD   bfSize;

	WORD    bfReserved1;

	WORD    bfReserved2;

	DWORD   bfOffBits;

};

typedef struct{

	DWORD      biSize;

	LONG       biWidth;

	LONG       biHeight;

	WORD       biPlanes;

	WORD       biBitCount;

	DWORD      biCompression;

	DWORD      biSizeImage;

	LONG       biXPelsPerMeter;

	LONG       biYPelsPerMeter;

	DWORD      biClrUsed;

	DWORD      biClrImportant;

} BMPINFOHEADER_T;

void Snapshot( BYTE * pData, int width, int height, char * filename );

#endif